package com.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.net.URL;
import java.util.Scanner;

public class PrinterWriterTest {
	public  static void main(String[] args) throws FileNotFoundException{
		URL path = Thread.currentThread().getContextClassLoader().getResource("");
		///System.out.println(path);
		PrintWriter pw = new PrintWriter(new FileOutputStream(path.getPath() + "\\test.txt"));
		//pw.write(1);
		//pw.write("dfdf");
		
		pw.print(1 + "  ");
		pw.print(223.444);
		pw.println("ffffff");
		pw.println("c");
		pw.close();
		
		Scanner sc = new Scanner(new FileInputStream(path.getPath() + "\\test.txt"));
		//sc.nextLine();
		//String str = null;
		while(sc.hasNextLine()){
			String str = sc.nextLine();
			System.out.println(str);
		}
		
	}
	
}
